import { mergeObjects } from '../utils/util'

export const virtualHostBehavior = Behavior({
  properties: {
    style: { // 定义 style 属性可以拿到 style 属性上设置的值
      type: String,
      value: ''
    }
  }
})

export const virtualHostConfig = ({ config = {}, behaviors = [], externalClasses = [] } = {}) => mergeObjects({
  options: {
    virtualHost: true,
    addGlobalClass: true
  },
  externalClasses: ['class', ...externalClasses], // 可以将 class 设为 externalClasses
  behaviors: [virtualHostBehavior, ...behaviors]
}, config)
